package com.nikmesoft.android.referendumfriend.adapters;

import java.util.List;

import javax.net.ssl.HostnameVerifier;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.nikmesoft.android.referendumfriend.R;
import com.nikmesoft.android.referendumfriend.models.ItAptMyAc;

public class Activity_adapter extends ArrayAdapter<ItAptMyAc> {
	private int resourceID;
	public static int like = 0;
	public static int unlike = 0;
	public static int kt = 0;

	// ViewHolder holder;

	public Activity_adapter(Context context, int resourceId,
			List<ItAptMyAc> objects) {
		super(context, resourceId, objects);
		this.resourceID = resourceId;
	}

	static class ViewHolder {
		public TextView like, unlike;
		public ImageView imageLike, imageUnLike;

	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ItAptMyAc status = getItem(position);
		View row = convertView;
	
		LayoutInflater inflater;
		inflater = (LayoutInflater) getContext().getSystemService(
				Context.LAYOUT_INFLATER_SERVICE);
		row = inflater.inflate(this.resourceID, null);

		
		TextView nameuser = (TextView) row.findViewById(R.id.groupname);
		nameuser.setText(status.getGroup());
		TextView statushobby = (TextView) row.findViewById(R.id.statushobby);
		statushobby.setText(status.getStatus());
		TextView dislike=(TextView) row.findViewById(R.id.unlike_tv);
		TextView like=(TextView) row.findViewById(R.id.like_tv);
		ImageView imlike=(ImageView)row.findViewById(R.id.imageLike);
		ImageView imunlike=(ImageView)row.findViewById(R.id.imageUnLike);
		String l=status.getId();
		String ul=status.getId();
		imlike.setTag(l);
		imunlike.setTag(ul);
		
		like.setText(status.getLike());
		dislike.setText(status.getDislike());
		
		return row;
	}

}
